{extend name="../../admin/view/main"}

{block name="button"}

<!--{if auth("add")}-->
<button data-modal='{:url("add")}' data-title="添加广告位" class='layui-btn layui-btn-sm layui-btn-primary'>添加广告位</button>
<!--{/if}-->

{/block}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white">
    <div class="layui-tab-content think-box-shadow">
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='text-left nowrap' width="120px">广告位名称</th>
                <th class='text-left nowrap' width="120px">广告位类型</th>
                <th class='text-left nowrap' width="150px">广告位尺寸</th>
                <th class='text-left nowrap'>广告位描述</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr data-dbclick>
                <td class='text-left nowrap'>
                    {$vo.name}
                </td>
                <td class='text-left nowrap'>
                    {:config('constant.advCatType')[$vo.type]}
                </td>
                <td class='text-left nowrap'>
                    {$vo.width} * {$vo.height} (px)
                </td>
                <td class='text-left nowrap'>
                    {$vo.description}
                </td>
                <td class='text-left nowrap'>
                    {$vo.create_at|format_datetime}
                </td>
                <td class='text-left nowrap'>
                    <!--{if auth("edit")}-->
                    <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑广告位" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                    <!--{/if}-->
                    <!--{if auth("delete")}-->
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要永久删除此广告位吗？" data-action="{:url('delete')}" data-value="id#{$vo.id}" data-csrf="{:systoken('delete')}">删 除</a>
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>
{/block}
